home *** CD-ROM | disk | FTP | other *** search
-
- XDEF StrNCmp
-
- ; StrNCmp() - Compares two strings in A0 and A1 for D0 bytes.
-
- ; Result:
- ; D0 = 0 if they are equal, non-zero if not.
-
- StrNCmp:
- subq.l #1,d0
- bpl.b .Cont
- moveq #0,d0 ; Were equal until here, return 0.
- rts
-
- .Cont:
- cmpm.b (a0)+,(a1)+
- beq.b .NullCheck
- bra.b .NotEqual
-
- .NullCheck:
- tst.b (a0)
- bne.b StrNCmp
- tst.b (a0)
- bne.b .NotEqual
- tst.b (a1)
- bne.b .NotEqual
- moveq #0,d0
- rts
-
- .NotEqual:
- moveq #-1,d0
- rts
-